package io;

import java.io.FileOutputStream;
import java.io.IOException;

/**
 * @author IT枫斗者
 * @ClassName FileOutputStreamDemo02.java
 * @From www.javatiaozao.com
 * @Description
 */
public class FileOutputStreamDemo01 {
    public static void main(String[] args) throws IOException {

        //FileOutputStream(String name)：创建文件输出流以指定的名称写入文件
        FileOutputStream fos = new FileOutputStream("myStream\\222.txt");
        byte[] bys = "abcde".getBytes();
        //void write(byte[] b, int off, int len)：将 len字节从指定的字节数组开始，从偏移量off开始写入此文件输出流
        //fos.write(bys,0,bys.length);
        fos.write(bys, 1, 3);

        //释放资源
        fos.close();
    }

}